@extends('layouts.admin')
@section('title', '分类添加')
@section('content')
    <div class="result_wrap">
        <form method="post" action="{{url('admin/cate')}}">
            {{csrf_field()}}
            @if (count($errors) > 0)
                <div class="mark" style="background: #6f1919;padding: 10px 10px;color: #fff; width: 600px;border-radius: 10px;margin-left: 60px;">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <p>{{ $error }}</p>
                        @endforeach
                    </ul>
                </div>
            @endif
            <table class="add_tab">
                <tbody>
                <tr>
                    <th width="120"><i class="require">*</i>分类名称：</th>
                    <td>
                        <input type="text" name="name" value="{{old('name')}}"> </i>请输入分类名称</span>
                    </td>
                </tr>
                <tr>
                    <th width="120"><i class="require">*</i>父级分类：</th>
                    <td>
                        <select name="pid">
                            <option value="0">==顶级分类==</option>
                            @foreach($cates as $k=>$v)
                                <option value="{{$v->id}}">{{$v->name}}</option>
                            @endforeach
                        </select>
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td>
                        <input type="submit" value="提交">
                        <input type="button" class="back" onclick="history.go(-1)" value="返回">
                    </td>
                </tr>
                </tbody>

            </table>

        </form>

    </div>
@endsection




